
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
About the Component Object Model</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="apptechp164.htm">Previous</A>&nbsp;&nbsp;<A HREF="apptechp166.htm" >Next</A>
<!-- End Header -->
<A NAME="CEGCBBFE"></A><h1>About the Component Object Model</h1>
<A NAME="TI5132"></A><p>The Microsoft Component Object Model (COM) defines a standard
way for software components to supply services to each other. Any
PowerBuilder custom class user object can be used as a COM object
by providing it with a runtime environment, a registry entry, and
optionally a type library. Clients built with COM-compliant tools
such as PowerBuilder and Visual Basic can make use of the business
logic in the COM object by creating an instance of the object and
calling the methods exposed in its interface. Depending on the interfaces
it supports, the COM object may also be available to Java and C++ clients.</p>
<A NAME="TI5133"></A><p>COM+ enhances
COM by handling more resource management tasks and providing thread
pooling, object pooling, and just-in-time object activation.</p>
<A NAME="BABDEHDJ"></A><h2>About PowerBuilder COM servers</h2>
<A NAME="TI5134"></A><p>PowerBuilder creates a single PowerBuilder COM server that
contains a PowerBuilder COM object for every custom class user object
you select when you build the project. </p>
<A NAME="TI5135"></A><p>COM specifies how objects are created and destroyed, how their
interfaces are exposed, and how their methods are invoked. PowerBuilder
COM servers follow the COM specification; this means that, from
a client perspective, the fact that a PowerBuilder COM object interacts
with a custom class user object (through the PowerBuilder virtual
machine) is transparent.</p>
<A NAME="BABBDBIH"></A><h2>Comparing automation servers and PowerBuilder COM servers</h2>
<A NAME="TI5136"></A><p>Earlier releases of PowerBuilder provided two ways to generate
COM objects: COM servers and automation servers. Both were accessible
from wizards and from the Project painter. PowerBuilder COM servers
offer many more features than automation servers.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>Automation servers no longer available</span> <A NAME="TI5137"></A>PowerBuilder no longer supports generating COM object in automation servers.
This section is maintained for informational purposes only.</p>
<p><b>PowerBuilder COM servers</b>    PowerBuilder COM servers can contain more than one custom
class user object. After you code the user objects, you use the Project
painter to generate a single self-registering DLL for all the objects.
You can also deploy the server directly to COM+ if it is
running on the build computer, or create a COM+ package.
PowerBuilder COM objects in a COM server can share runtime sessions,
and references can be passed between objects created from the same
COM client. </p>
<A NAME="TI5138"></A><p>The COM server also contains an embedded PowerBuilder dynamic
library (PBD) file that contains compiled versions of all the custom
class user objects you selected and any dependent objects, as well
as registry and type library information.</p>
<A NAME="TI5139"></A><p>You deploy the PowerBuilder COM server with the PowerBuilder
virtual machine, along with any other PowerBuilder runtime files
the server requires.</p>
<p><b>Automation servers</b>   Automation servers built from a custom class user object (in
earlier versions of PowerBuilder) contained only one object. After you
coded the user object, you had to build a runtime library from the
PBL that contained it, and use the Project painter to create a registry
file and optional type library file. After deploying the automation
server, you could customize the registry file for the user's
computer and run the file to register the automation server.</p>
<A NAME="TI5140"></A><h4>Dispatch, dual, and custom interfaces</h4>
<A NAME="TI5141"></A><p>Automation servers use a dispatch interface (also called dispinterface)
that allows users to invoke methods on the server using the <b>Invoke</b> method
of a standard COM interface called IDispatch. </p>
<A NAME="TI5142"></A><p>COM servers can use custom or dual interfaces, which provide
better performance than dispatch-based interfaces. A custom interface
provides access to methods on the server through a virtual table
(also called VTBL or vtable) that contains pointers to methods in
the server's interface. A dual interface enables the client
to invoke methods using <b>IDispatch::Invoke</b> or
a virtual table.</p>
<A NAME="TI5143"></A><p>For more information, see <A HREF="apptechp171.htm#CEGEBFIG">"Choosing a custom or dual
interface"</A>.</p>
<A NAME="TI5144"></A><h4>Summary of differences between servers</h4>
<A NAME="TI5145"></A><p><A HREF="apptechp165.htm#CEGEJFEH">Table 26-1</A> summarizes
the differences between PowerBuilder automation servers and PowerBuilder
COM servers using dual or custom interfaces:</p>
<A NAME="CEGEJFEH"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 26-1: Comparison of automation servers
and COM servers</caption>
<tr><th  rowspan="1"  ><A NAME="TI5146"></A>Feature</th>
<th  rowspan="1"  ><A NAME="TI5147"></A>Automation server<sup>*</sup> (dispatch interface)</th>
<th  rowspan="1"  ><A NAME="TI5148"></A>COM server (dual interface)</th>
<th  rowspan="1"  ><A NAME="TI5149"></A>COM server (custom interface)</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5150"></A>In-process server support</td>
<td  rowspan="1"  ><A NAME="TI5151"></A>Yes<sup>#</sup></td>
<td  rowspan="1"  ><A NAME="TI5152"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5153"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5154"></A>Generated IDL files</td>
<td  rowspan="1"  ><A NAME="TI5155"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5156"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5157"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5158"></A>C++ client support</td>
<td  rowspan="1"  ><A NAME="TI5159"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5160"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5161"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5162"></A>Java client support</td>
<td  rowspan="1"  ><A NAME="TI5163"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5164"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5165"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5166"></A>PowerBuilder client support</td>
<td  rowspan="1"  ><A NAME="TI5167"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5168"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5169"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5170"></A>Visual Basic 4 client support</td>
<td  rowspan="1"  ><A NAME="TI5171"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5172"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5173"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5174"></A>Visual Basic 5 custom interface support</td>
<td  rowspan="1"  ><A NAME="TI5175"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5176"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5177"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5178"></A>Support for PowerBuilder structures as
instance variables and method argument types</td>
<td  rowspan="1"  ><A NAME="TI5179"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5180"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5181"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5182"></A>Support for all C language datatypes</td>
<td  rowspan="1"  ><A NAME="TI5183"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5184"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5185"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5186"></A>Support for an embedded type library</td>
<td  rowspan="1"  ><A NAME="TI5187"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5188"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5189"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5190"></A>Self-registering servers</td>
<td  rowspan="1"  ><A NAME="TI5191"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5192"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5193"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5194"></A>Support for DCOM <sup>$</sup></td>
<td  rowspan="1"  ><A NAME="TI5195"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5196"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5197"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5198"></A>Support for <ABBR title = "e a server" >EAServer</ABBR> </td>
<td  rowspan="1"  ><A NAME="TI5199"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5200"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5201"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5202"></A>Support for COM+ </td>
<td  rowspan="1"  ><A NAME="TI5203"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5204"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5205"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5206"></A>Requires separate proxy/stub DLLs </td>
<td  rowspan="1"  ><A NAME="TI5207"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5208"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5209"></A>No</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5210"></A>Requires PowerBuilder runtime DLLs (minimally <i>PBVM115.DLL</i> and
its dependencies)</td>
<td  rowspan="1"  ><A NAME="TI5211"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5212"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5213"></A>Yes</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI5214"></A>Requires deployment of application runtime
libraries built in Library painter</td>
<td  rowspan="1"  ><A NAME="TI5215"></A>Yes</td>
<td  rowspan="1"  ><A NAME="TI5216"></A>No</td>
<td  rowspan="1"  ><A NAME="TI5217"></A>No</td>
</tr>
</table>
<A NAME="TI5218"></A><p><sup>*</sup>    Available
in earlier releases of PowerBuilder only</p>
<A NAME="TI5219"></A><p><sup>#</sup>    In-process
server is the PowerBuilder execution DLL (PBVM115.DLL)</p>
<A NAME="TI5220"></A><p><sup>$</sup>    Requires
use of surrogate host to house the PowerBuilder execution DLL</p>

